<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>onsubmit事件</title>
</head>
<body>
<!--将页面上用户输入的内容提交到服务器指定的资源上-->
<form action="/index.html" method="get" onsubmit="return fn1()">
    账户:<input type="text" name="username"><br>
    <button type="submit">提交</button>
</form>
</body>
<script>
    function fn1() {
        console.log("表单提交了--------------")
        //静止表单提交参数
        //return true;//允许表单提交
        return false;//静止表单提交

    }
</script>
</html>